//
//  YCHud.m
//  nurseGroupPatient
//
//  Created by 董知樾 on 2016/12/19.
//  Copyright © 2016年 董知樾. All rights reserved.
//

#import "YCHud.h"
#import "SVProgressHUD.h"

@implementation YCHud

+ (void)show {
    [SVProgressHUD show];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
}

+ (void)showSuccess {
    [YCHud showSuccessWithStatus:nil];
}

+ (void)showSuccessWithStatus:(NSString *)status {
    [SVProgressHUD showSuccessWithStatus:status];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)showError {
    [YCHud showErrorWithStatus:nil];
}

+ (void)showErrorWithStatus:(NSString *)status {
    [SVProgressHUD showErrorWithStatus:status];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)showWithStatus:(NSString *)status {
    [YCHud showWithStatus:status style:YCHUDStyleDark];
}

+ (void)showWithStatus:(NSString *)status style:(YCHUDStyle)style {
    [SVProgressHUD showWithStatus:status];
    [SVProgressHUD setDefaultStyle:(SVProgressHUDStyle)style];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)showWithStatus:(NSString *)status style:(YCHUDStyle)style maskType:(YCHUDMaskType)maskType {
    [SVProgressHUD showWithStatus:status];
    [SVProgressHUD setDefaultStyle:(SVProgressHUDStyle)style];
    [SVProgressHUD setDefaultMaskType:(SVProgressHUDMaskType)maskType];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)showInfoWithStatus:(NSString*)status {
    [YCHud showInfoWithStatus:status style:YCHUDStyleDark];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)showInfoWithStatus:(NSString*)status style:(YCHUDStyle)style {
    [SVProgressHUD showInfoWithStatus:status];
    [SVProgressHUD setDefaultStyle:(SVProgressHUDStyle)style];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)showInfoWithStatus:(NSString *)status style:(YCHUDStyle)style maskType:(YCHUDMaskType)maskType {
    [SVProgressHUD showInfoWithStatus:status];
    [SVProgressHUD setDefaultStyle:(SVProgressHUDStyle)style];
    [SVProgressHUD setDefaultMaskType:(SVProgressHUDMaskType)maskType];
    [SVProgressHUD dismissWithDelay:1];
}

+ (void)dismiss {
    [SVProgressHUD dismiss];
}

+ (void)dismissWithDelay:(NSTimeInterval)time {
    [SVProgressHUD dismissWithDelay:time];
}


@end
